1. Field of the Invention
The present invention relates to peripheral device identification and interrupt management. More specifically, the present invention pertains to a method and system that enables device identification to be performed without a rigid time limit within which an intial interrupt from the device needs to be serviced.
2. Related Art
Computer systems and other electronic devices have become integral tools that are used extensively to perform a wide variety of useful operations in modern society. Applications of computer systems can be found in virtually all fields and disciplines, including but not limited to business, industry, scientific research, education and entertainment. For instance, computer systems are used to analyze financial data, to control industrial machinery, to model chemical molecules, to deliver classroom presentations and to generate special effects for movies. Moreover, computer systems along with other electronic devices are finding new applications as a result of advances in hardware technology and rapid development in software technology. The growing affordability of computer systems and electronic devices together with the abundance of useful new applications have fueled strong demand for such systems and devices.
Included within this broad category of computers and electronic devices is the personal digital assistant (commonly referred to as a PDA). Specifically, as the components required to build a computer system have been greatly reduced in size, new categories of computer systems have emerged. One of these new categories of computer systems is the PDA. A PDA is a portable computer system which is small enough to be held conveniently and comfortably in the hand of its user. In particular, a popular size for the typical PDA approximates the size of a palm.
The PDA is usually a battery-powered device that is typically used as an electronic organizer having the capability to store and display a wide range of information which can include numerous addresses and telephone numbers of business and personal acquaintances, financial information, daily appointments, along with various other personal information. As such, the PDA is able to consolidate a wide variety of information and make the information easily accessible by its user. Therefore, PDAs are very useful and have gained wide popularity.
Since PDAs are such small devices, full-sized keyboards are generally not efficient input devices. For instance, PDAs using keyboards usually have keyboard devices that are so small that a user typically cannot touch-type on them. Many PDAs thus employ a stylus and a digitizer pad as an input system. The stylus and digitizer pad work well for PDAs because the arrangement allows a user to hold the PDA in one hand while writing with the stylus onto the digitizer pad with the other hand. A small on-screen keyboard image can also be used for data entry. By eliminating the need for a keyboard, PDAs are very portable and can be carried along by their users wherever they go, even when on extended travel. On the other hand, due to their small size, PDAs usually have a modest set of built-in functions and it is often beneficial to couple peripheral devices therewith to expand functionality. The greater the variety of peripheral devices a PDA is capable of operating with, the broader the functionality it can achieve.
Moreover, the management of communications port contention and power consumption affect the ease of use and the battery life of PDAs and other hand-held computers. A typical PDA includes limited communications port resources. For example, the Palm V personal organizer, manufactured by Palm Computing, Inc. of Santa Clara, Calif., has a single communications port available to interface with peripherals. When the communications port is exclusively occupied by a peripheral, the communications port is unavailable for other uses. Thus, a PDA with an active keyboard occupying the communications port, for instance, may be unable to perform an infrared (IR) synchronization process with another device.
Another ease of use issue is the degree of user intervention required to manage a communications port and identify peripheral devices coupled thereto. Requiring a user to manually open the communications port and identify a peripheral device, such as through the graphical user interface (GUI) or the buttons of the PDA or hand-held computer, is generally less preferable to automatically opening the communications port and identifying the peripheral device when the PDA receives information from a peripheral device upon coupling. Further, requiring a user to explicitly close the communications port is also generally less desirable than automatically closing the communications port after the peripheral device and the PDA no longer exchange data. In one existing solution, the PDA will automatically close a communications channel, which was opened to work with a keyboard peripheral, when the PDA is prompted with a signal initiating a synchronization process, such as when the PDA is placed in a cradle for a HotSync process. However, if a user forgets to explicitly close the communications port after using a keyboard that occupied the communications port, the user may be unable to perform an infrared synchronization process. In such cases, the synchronization process cannot be initiated until the situation is resolved. A user unfamiliar with the problem may even have the mistaken impression that the PDA has malfunctioned.
Furthermore, requiring a user to manually close the communications port also affects power consumption. Battery powered systems, such as PDAs and other hand-held devices, are sensitive to applications that drain excessive power. Thus, PDAs mostly leave their communications ports in a low power standby mode, because an open communications channel may consume significant power. For example, the Palm V personal organizer has a communications port included in the processor that is shared between an infrared communications port and an RS-232 serial communications port. The Palm V hand-held organizer keeps these ports in standby mode to reduce power consumption. A user who forgets to close the communications port after a peripheral device is no longer being used may suffer a significantly decreased battery life, and be forced to recharge or change batteries often.
Even if a user remembers to close the communications port when the attached peripheral device is no longer being used, the port has to be reopened for further communications with a peripheral device when use is resumed. When the communications port is reopened, the attached peripheral device needs to be identified. Identifying the peripheral device permits the PDA to open appropriate applications and select appropriate communication protocols. Some existing hand-held computers provide limited capability for identifying peripheral devices. For example, in an existing Palm organizer, this is implemented with two pins on a serial port. According to this technique, an interrupt is generated by bringing up one of the pins (e.g., making the pin xe2x80x9chighxe2x80x9d). An interrupt routine then checks the second pin to determine if it is high or low (e.g., high indicates modem, low indicates cradle). One problem with this technique is that it only allows two different types of devices to wake up the serial port. In other words, this peripheral device identification scheme is limited to identifying one of two devices, for example, a cradle versus a modem. As hand-held computer technology advances and its applications multiply, an increasing number of peripheral devices are becoming available for use with hand-held computers and PDAs, but the existing device identification technique are not capable of distinguishing among the numerous devices.
Some other approaches to peripheral device identification are capable of identifying more than two types of devices. Typically, such approaches involve performing certain detection activities in a given time period immediately following the initial interrupt generated by the device as described above. According to these approaches, additional input is generated by the peripheral device and received by the hand-held computer during this prescribed time period. For example, the additional input may include one or more specific characters or additional interrupt(s). Based on the additional input, such as by monitoring for the specific inbound character(s) or by counting the additional interrupts, the hand-held computer determines the type of the peripheral device being coupled thereto.
Nevertheless, these identification schemes also have their shortcomings. In particular, these schemes impose a hard limit on the latency within which the initial interrupt generated by the peripheral device must be handled in order for the respective schemes to succeed. Such a time-critical interrupt response requirement is undesirable because the hand-held computer may be engaged in other computations when the initial interrupt is generated and thus may be unable to service the interrupt within the requisite time frame. Under these circumstances, peripheral device identification according to these time-critical schemes would fail.
Thus, in view of the foregoing problems that are inherent in existing peripheral device identification schemes, it would be highly advantageous to provide a peripheral device identification system and method that facilitates extendible identification of various peripheral devices, where the successful operation of the system and method does not require that the initial interrupt generated by the peripheral device be handled within a critical time period.
Additionally, a method and system for peripheral device identification should not require complete revamping of existing hand-held computer systems or PDAs. In other words, in implementing a viable method and system for peripheral device identification, components that are well known in the art and are compatible with existing hand-held computer systems need to be used so that the cost of realizing the method and system for peripheral device identification is low. By so doing, the need to incur costly expenditures for retrofitting existing hand-held computer systems or for building custom components is eliminated.
It would be advantageous to provide a method and system for peripheral device identification that enables extendible identification of various peripheral devices, and yet the successful operation of the system and method does not require that the initial interrupt generated by the peripheral device be handled within a critical time period. Furthermore, it would also be advantageous for such method and system to utilize components that are well known in the art and are compatible with existing computer systems such that the method and system can readily operate with other systems and applications without extensive retrofitting.
Accordingly, the present invention provides a method and system for extendible identification of peripheral devices which is latency-independent. More particularly, embodiments of the present invention impose no critical interrupt response requirement for successful operation, thus providing a superior and more flexible solution to peripheral device identification than existing approaches. Moreover, embodiments of the present invention can be efficiently implemented using components that are well known in the art and are compatible with existing hand-held computer systems as well as peripheral devices. As such, the present invention delivers a method and system that is readily operable with existing systems and applications without extensive retrofitting. These and other advantages of the present invention not specifically mentioned above will become clear within discussions of the present invention presented herein.
More specifically, in one embodiment of the present invention, a method for identifying a peripheral device detachably coupled to a computer system is provided. In this embodiment, an interrupt is received by the computer system from the peripheral device, which is coupled to a communications port of the computer system. In response to the interrupt, an interrupt notification message is posted to alert a notification handler running on the computer system. It is next determined whether the interrupt is indicative of a compliant peripheral class. In one embodiment, this is achieved by examining a device sense pin of the communications port to determine the voltage thereon. If the interrupt is determined to be indicative of the compliant peripheral class and the communications port is inactive, the port is opened, and an inquiry is sent to the peripheral device via the open port. The computer system then waits to receive a response from the peripheral device via the open communications port. If a response is received within a predetermined time period, an identification notification message is posted based on data in the response, which data include information for classifying the peripheral device, so that a software handler registered with the operating system can handle the identification notification message when the software handler receives it.
In a specific embodiment, the present invention includes the above and wherein the computer system is a PDA. In a currently preferred embodiment, the present invention includes the above and wherein the compliant peripheral class comprises RS-232 peripherals.
Another embodiment of the present invention includes the above recited steps and further comprises the step of posting a no-response notification message to trigger further processing, if no response is received within the predetermined time period after the inquiry is sent.